<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<div>
    <table style="width:100%;" id="dataPreviewTable" lay-filter="dataPreviewTable"></table>
</div>
</body>
<script src="../../../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="../../../lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="../../../lib/SheetJS/xlsx.full.min.js" charset="utf-8"></script>
<script src="../../../lib/common/common.js" charset="utf-8"></script>
<script>
    function renderTable(headerData, columnData) {
        let data = [];
        for (let i = 0; i < columnData.length; i++) {
            // 父子窗口的数组的constructor 构造函数引用不一致导致 不能直接把数组放过去
            data.push(columnData[i])
        }
        // 渲染表格
        layui.use('table', function () {
            let table = layui.table;
            table.render({
                elem: "#dataPreviewTable",
                cols: [headerData],
                data: data,
                limit: data.length
            });
        });
    }
</script>
</html>